/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/

#include <string.h>
#include <flgrCoreVector.h>
#include <flgrCoreDispatch.h>

#ifdef __SSE__
#include <mmintrin.h>
#include <xmmintrin.h>
#endif

#include "flgrArithSSE.h"

#define FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(instr,dtype,set_vec_const) \
  __m64 r1,r2;							\
  void *psrc1 = data1->array;					\
  void *pdest = datdest->array;					\
  int j,c = (sizeof(__m64)*8)/data1->bps;			\
  int length = datdest->length;					\
  								\
  FLGR_DECLARE_FUNCTION;					\
								\
  _mm_empty();							\
  r2=set_vec_const(*((dtype*) (vec_const->array)));		\
								\
  								\
  for(j=0;j<length;j+=c) {					\
    r1 = *((__m64*) psrc1);					\
    r1 = instr(r1,r2);						\
    *((__m64*) pdest) = r1;					\
								\
    psrc1+=sizeof(__m64);					\
    pdest+=sizeof(__m64);					\
  }								\
  								\
  _mm_empty();							\
								\
  return


#define FLGR_MACRO_ARITH_1D_DIADIC_SSE(instr)	\
  __m64 r1,r2;					\
  void *psrc1 = data1->array;			\
  void *psrc2 = data2->array;			\
  void *pdest = datdest->array;			\
  int j,c = (sizeof(__m64)*8)/data1->bps;	\
  int length = datdest->length*datdest->spp;	\
						\
  FLGR_DECLARE_FUNCTION;			\
						\
  _mm_empty();					\
  						\
  for(j=0;j<length;j+=c) {			\
    r1 = *((__m64*) psrc1);			\
    r2 = *((__m64*) psrc2);			\
    r1 = instr(r1,r2);				\
    *((__m64*) pdest) = r1;			\
						\
    psrc1+=sizeof(__m64);			\
    psrc2+=sizeof(__m64);			\
    pdest+=sizeof(__m64);			\
  }						\
						\
  _mm_empty();					\
  return


void flgr1d_arith_inf_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_inf_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_min_pu8);
#endif
}
void flgr1d_arith_inf_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_min_pi16);
#endif
}


void flgr1d_arith_sup_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_sup_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_max_pu8);
#endif
}
void flgr1d_arith_sup_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_max_pi16);
#endif
}



void flgr1d_arith_and_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_and_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_and_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_and_SSE_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_and_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_and_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}
void flgr1d_arith_and_SSE_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_and_si64);
#endif
}




void flgr1d_arith_or_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_or_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_or_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_or_SSE_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_or_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_or_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}
void flgr1d_arith_or_SSE_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_or_si64);
#endif
}




void flgr1d_arith_xor_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_xor_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_xor_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_xor_SSE_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_xor_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_xor_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_xor_SSE_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}



void flgr1d_arith_add_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_add_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_add_pi8);
#endif
}
void flgr1d_arith_add_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_add_pi16);
#endif
}
void flgr1d_arith_add_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_add_pi8);
#endif
}
void flgr1d_arith_add_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_add_pi16);
#endif
}



void flgr1d_arith_addsat_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_adds_pu8);
#endif
}
void flgr1d_arith_addsat_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_adds_pu16);
#endif
}
void flgr1d_arith_addsat_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_adds_pi16);
#endif
}



void flgr1d_arith_sub_SSE_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_xor_si64);
#endif
}
void flgr1d_arith_sub_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_sub_pi8);
#endif
}
void flgr1d_arith_sub_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_sub_pi16);
#endif
}
void flgr1d_arith_sub_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_sub_pi8);
#endif
}
void flgr1d_arith_sub_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_sub_pi16);
#endif
}



void flgr1d_arith_subsat_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_subs_pu8);
#endif
}
void flgr1d_arith_subsat_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_subs_pu16);
#endif
}
void flgr1d_arith_subsat_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE(_mm_subs_pi16);
#endif
}







void flgr1d_arith_const_inf_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_min_pu8,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_inf_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_min_pi16,fgINT16,_mm_set1_pi16);
#endif
}



void flgr1d_arith_const_sup_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_max_pu8,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_sup_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_max_pi16,fgINT16,_mm_set1_pi16);
#endif
}



void flgr1d_arith_const_and_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_and_si64,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_and_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_and_si64,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_and_spp1_SSE_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_and_si64,fgUINT32,_mm_set1_pi32);
#endif
}
void flgr1d_arith_const_and_spp1_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_and_si64,fgINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_and_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_and_si64,fgINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_and_spp1_SSE_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_and_si64,fgINT32,_mm_set1_pi32);
#endif
}



void flgr1d_arith_const_or_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_or_si64,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_or_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_or_si64,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_or_spp1_SSE_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_or_si64,fgUINT32,_mm_set1_pi32);
#endif
}
void flgr1d_arith_const_or_spp1_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_or_si64,fgINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_or_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_or_si64,fgINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_or_spp1_SSE_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_or_si64,fgINT32,_mm_set1_pi32);
#endif
}



void flgr1d_arith_const_xor_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_xor_si64,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_xor_si64,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_xor_si64,fgUINT32,_mm_set1_pi32);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_xor_si64,fgINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_xor_si64,fgINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_xor_si64,fgINT32,_mm_set1_pi32);
#endif
}



void flgr1d_arith_const_add_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_add_pi8,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_add_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_add_pi16,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_add_spp1_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_add_pi8,fgINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_add_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_add_pi16,fgINT16,_mm_set1_pi16);
#endif
}



void flgr1d_arith_const_addsat_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_adds_pu8,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_addsat_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_adds_pu16,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_addsat_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_adds_pi16,fgINT16,_mm_set1_pi16);
#endif
}



void flgr1d_arith_const_sub_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
 FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_sub_pi8,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_sub_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
 FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_sub_pi16,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_sub_spp1_SSE_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
 FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_sub_pi8,fgINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_sub_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
 FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_sub_pi16,fgINT16,_mm_set1_pi16);
#endif
}



void flgr1d_arith_const_subsat_spp1_SSE_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_subs_pu8,fgUINT8,_mm_set1_pi8);
#endif
}
void flgr1d_arith_const_subsat_spp1_SSE_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_subs_pu16,fgUINT16,_mm_set1_pi16);
#endif
}
void flgr1d_arith_const_subsat_spp1_SSE_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE(_mm_subs_pi16,fgINT16,_mm_set1_pi16);
#endif
}
